﻿using System.Web.Mvc;

namespace AutoPartsSearch.Web.Areas.Administration
{
    public class AdministrationAreaRegistration : AreaRegistration
    {
        public override string AreaName
        {
            get
            {
                return "Administration";
            }
        }

        public override void RegisterArea(AreaRegistrationContext context)
        {
            context.MapRoute(
                null,
                "Administration",
                new { action = "Index", controller = "Home" }
            );

            context.MapRoute(
                null,
                "Administration/BlackList/{action}/{id}",
                defaults: new { controller = "BlackList", id = UrlParameter.Optional },
                namespaces: new[] { "AutoPartsSearch.Web.Areas.Administration.Controllers" }
            );

            context.MapRoute(
                "Administration_default",
                "Administration/{controller}/{action}/{id}",
                defaults: new { action = "Index", id = UrlParameter.Optional },
                namespaces: new[] { "AutoPartsSearch.Web.Areas.Administration.Controllers" }
            );
        }
    }
}
